home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / text / mac / faqs.384 < prev    next >
Encoding:
Text File  |  1996-02-12  |  27.6 KB  |  1,065 lines

  1. Frequently Asked Questions (FAQS);faqs.384
  2.  
  3.  
  4. }
  5.  
  6. /* User Pressed the "Stop" button in dialog. */
  7. void
  8. stop(dialog)
  9. Widget dialog;
  10. {
  11.     stopped = True;
  12. }
  13.  
  14. Boolean
  15. CheckForInterrupt()
  16. {
  17.     extern Widget shell;
  18.     Display *dpy = XtDisplay(shell);
  19.     Window win = XtWindow(dialog);
  20.     XEvent event;
  21.  
  22.     /* Make sure all our requests get to the server */
  23.     XFlush(dpy);
  24.  
  25.     /* Let motif process all pending exposure events for us. */
  26.     XmUpdateDisplay(shell);
  27.  
  28.     /* Check the event loop for events in the dialog ("Stop"?) */
  29.     while (XCheckMaskEvent(dpy,
  30.             ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
  31.             PointerMotionMask | KeyPressMask | KeyReleaseMask,
  32.             &event)) {
  33.         /* got an "interesting" event. */
  34.         if (event.xany.window == win)
  35.             XtDispatchEvent(&event); /* it's in our dialog.. */
  36.         else /* uninteresting event--throw it away and sound bell */
  37.             XBell(dpy, 50);
  38.     }
  39.     return stopped;
  40. }
  41.  
  42.  
  43. -----------------------------------------------------------------------------
  44. Subject: 140)  What order should the libraries be linked in?
  45. [Last modified: August 92]
  46.  
  47. Answer: At link time, use the library order  -lXm -lXt -lX11. There are two
  48. reasons for this (dbrooks@osf.org):
  49.  
  50. On most systems, the order matters because the linker won't re-scan a library
  51. once it is done with it.  Thus any references to Xlib calls from Xm will
  52. probably be unresolved.
  53.  
  54. The [other] problem is that there are two VendorShell widgets. A dummy is
  55. provided in the Xt library, but a widget set will rely on its own being
  56. referenced.  If you mention Xt first, the linker will choose the wrong one.
  57.  
  58. Motif code will wrongly assume the Motif VendorShell has been class-
  59. initialized [and will probably crash].
  60.  Xaw has a similar problem, but a softer landing; it only complains about
  61. unregistered converters.
  62.  
  63.  
  64. -----------------------------------------------------------------------------
  65. Subject: 141)  How do I use xmkmf for Motif clients?
  66.  
  67. [Last modified: October 1992]
  68.  
  69. Answer: This advice comes from dbrooks@osf.org:
  70.  
  71. There are a number of intractable problems with using X configuration files
  72. and xmkmf, while trying to make it easy to build Motif.  Not the least of
  73. these, but one I've never heard mentioned yet, is that the rules for
  74. contructing the names of shared library macros are machine-dependent, and in
  75. the various xxxLib.tmpl files.  Do we edit all those files to add definitions
  76. for XMLIB, DEPXMLIB, etc., or do we put a maze of #ifdefs into the Motif.tmpl
  77. file?
  78.  
  79. Please note that, if you install Motif, it overwrites your installed
  80. Imake.tmpl with one that includes Motif.tmpl and Motif.rules.
  81.  
  82. With those caveats, I think the following guidelines will help.
  83.  
  84. David Brooks OSF
  85.  
  86. Clients in the X11R5 release use the xmkmf command to build Makefiles.  In
  87. general, the xmkmf command cannot be used for Motif clients, because of the
  88. need to consider the UseInstalledMotif flag separately.  Since xmkmf is a
  89. simple script that calls imake, it is easy to construct the proper call to
  90. imake using the following rules.
  91.  
  92. In the following, replace {MTOP} by the toplevel directory with the Motif
  93. source tree, and {XTOP} by the toplevel ("mit") directory with the X source.
  94. It is assumed that the directory containing your installed imake is in your
  95. PATH.
  96.  
  97. When needed, the imake variables XTop and MTop are normally set in your
  98. site.def (to {XTOP} amd {MTOP} respectively); however they may also be set
  99. with additional -D arguments to imake.
  100.  
  101. 1. With both X and Motif in their source trees, ensure the imake variables
  102.    XTop and MTop are set, and use:
  103.  
  104.         ${XTOP}/config/imake -I{MTOP}/config
  105.  
  106. 2. With Motif in its source tree, and X installed, ensure MTop is set, and
  107.    use:
  108.  
  109.         imake -I{MTOP}/config -DUseInstalled
  110.  
  111. 3. With both Motif and X installed, and a nonstandard ProjectRoot (see
  112.    site.def for an explanation of this), use:
  113.  
  114.         imake -DUseInstalled -DUseInstalledMotif -I{ProjectRoot}/lib/X11/config
  115.  
  116.    or, if the configuration files are in /usr/lib/X11/config:
  117.  
  118.         imake -DUseInstalled -DUseInstalledMotif
  119.  
  120.  
  121. To build a simple Imakefile, remember to include lines like this:
  122.  
  123.         LOCAL_LIBRARIES = XmClientLibs
  124.                 DEPLIBS = XmClientDepLibs
  125.  
  126. Or, for a client that uses uil/mrm, replace these by MrmClientLibs and
  127. MrmClientDepLibs, and also use:
  128.  
  129.         MSimpleUilTarget(program)
  130.  
  131. to build the client and uid file.  Look at the demos for more examples.
  132.  
  133.  
  134. And Paul Howell <grue@engin.umich.edu> added:
  135.  
  136. i did this, calling the new script "xmmkmf".  It passes both -DUseInstalled
  137. and -DUseInstalledMotif.
  138.  
  139. and i modified the stock R5 Imake.tmpl to do this:
  140.  
  141. #include <Project.tmpl>
  142. #ifdef UseInstalledMotif
  143. #include <Motif.tmpl>
  144. #endif
  145.  
  146. #include <Imake.rules>
  147. #ifdef UseInstalledMotif
  148. #include <Motif.rules>
  149. #endif
  150.  
  151. the result was something that does both athena and motif rules.  and it really
  152. works, just that easy!
  153.  
  154.  
  155. -----------------------------------------------------------------------------
  156. Subject: 142)  How do I make context sensitive help?  The Motif Style Guide
  157. says that an application must initiate context-sensitive help by changing the
  158. shape of the pointer to the question pointer. When the user moves the pointer
  159. to the component help is wanted on and presses BSelect, any available context
  160. sensitive help for the component must be presented, and the pointer reverts
  161. from the question pointer.
  162. [Last modified: August 92]
  163.  
  164. Answer: A widget that gives context sensitive help would place this help in
  165. the XmNhelpCallback function. To trigger this function: (from Martin G C
  166. Davies, mgcd@se.alcbel.be)
  167.  
  168. I use the following callback that is called when the "On Context" help
  169. pulldown menu is selected. It does the arrow bit and calls the help callbacks
  170. for the widget. It also zips up the widget tree looking for help if needs be.
  171. I don't restrict the arrows motion so I can get help on dialog boxes. No
  172. prizes for guessing what "popup_message" does.
  173.  
  174.  
  175. static void ContextHelp(
  176.     Widget              w ,
  177.     Opaque              * tag ,
  178.     XmAnyCallbackStruct * callback_struct
  179. )
  180. {
  181.     static Cursor   context_cursor = NULL ;
  182.     Widget          context_widget ;
  183.  
  184.     if ( context_cursor == NULL )
  185.         context_cursor = XCreateFontCursor( display, XC_question_arrow ) ;
  186.  
  187.     context_widget = XmTrackingLocate( top_level_widget,
  188.                                 context_cursor, FALSE ) ;
  189.  
  190.     if ( context_widget != NULL ) /* otherwise its not a widget */
  191.     {
  192.         XmAnyCallbackStruct cb ;
  193.  
  194.         cb.reason = XmCR_HELP ;
  195.         cb.event = callback_struct->event ;
  196.  
  197.         /*
  198.          * If there's no help at this widget we'll track back
  199.            up the hierarchy trying to find some.
  200.          */
  201.  
  202.         do
  203.         {
  204.             if ( ( XtHasCallbacks( context_widget, XmNhelpCallback ) ==
  205.                                                 XtCallbackHasSome ) )
  206.             {
  207.                 XtCallCallbacks( context_widget, XmNhelpCallback, & cb ) ;
  208.                 return ;
  209.             }
  210.             else
  211.                 context_widget = XtParent( context_widget ) ;
  212.         } while ( context_widget != NULL ) ;
  213.     }
  214.  
  215.     popup_message( "No context-sensitive help found\n\
  216. for the selected object." ) ;
  217. }
  218.  
  219.  
  220.  
  221. Dave Bonnett suggested, to use the following translations for XmText (and
  222. XmTextField) widgets to get the same help with key strokes, and to provide an
  223. accelerator label in the Context help menu entry.
  224.  
  225. MyApp*XmText*translations: #override\n\
  226.                                 <Key>F1:    Help()
  227.  
  228. MyApp*Help_menu*Contextual Help.acceleratorText:   F1
  229.  
  230. MyApp*defaultVirtualBindings:           osfBackSpace : <Key>Delete\n\
  231.                                         osfRight : <Key>Right\n\
  232.                                         osfLeft  : <Key>Left\n\
  233.                                         osfUp    : <Key>Up\n\
  234.                                         osfHelp  : <Key>F1\n\
  235.                                         osfDown  : <Key>Down
  236.  
  237. -----------------------------------------------------------------------------
  238. Subject: 143) TOPIC: ACKNOWLEDGEMENTS
  239.  
  240. This list was compiled using questions and answers posed to
  241. comp.windows.x.motif and motif-talk. Some extracts were also taken from FAQs
  242. of comp.windows.x.  To all who contributed one way or the other, thanks! I
  243. haven't often given individual references, but  you may recognise
  244. contributions. If I have mangled them too much, let me know.
  245.  
  246.  
  247.  
  248. That's all folks!
  249.  
  250.  
  251. +----------------------+---+
  252.   Jan Newmarch, Information Science and Engineering,
  253.   University of Canberra, PO Box 1, Belconnen, Act 2616
  254.   Australia. Tel: (Aust) 6-2522422. Fax: (Aust) 6-2522999
  255.  
  256.   ACSnet: jan@ise.canberra.edu.au
  257.   ARPA:   jan%ise.canberra.edu.au@uunet.uu.net
  258.   UUCP:   {uunet,ukc}!munnari!ise.canberra.edu.au!jan
  259.   JANET:  jan%au.edu.canberra.ise@EAN-RELAY
  260.  
  261. +--------------------------+
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746. Local Variables:
  747. mode: outline
  748. outline-regexp: "Subject: +[0-9]+)"
  749. eval: (hide-body)
  750. End:
  751. --
  752. +----------------------+---+
  753.   Jan Newmarch, Information Science and Engineering,
  754.   University of Canberra, PO Box 1, Belconnen, Act 2616
  755.   Australia. Tel: (Aust) 6-2012422. Fax: (Aust) 6-2015041
  756. Xref: bloom-picayune.mit.edu comp.os.msdos.programmer:18887 news.answers:4710
  757. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!mcsun!uknet!doc.ic.ac.uk!agate!ames!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ncoast!brown
  758. From: brown@NCoast.ORG (Stan Brown)
  759. Newsgroups: comp.os.msdos.programmer,news.answers
  760. Subject: comp.os.msdos.programmer FAQ diffs
  761. Message-ID: <msdos-faq-diff.921220@NCoast.ORG>
  762. Date: 20 Dec 92 20:04:33 GMT
  763. Expires: Thu, 14 Jan 1993 20:04:33 GMT
  764. References: none
  765. Followup-To: comp.os.msdos.programmer
  766. Organization: Oak Road Systems, Cleveland Ohio USA
  767. Lines: 269
  768. Approved: news-answers-request@MIT.Edu
  769.  
  770. Archive-name: msdos-programmer-faq/diff1
  771. Last-modified: 20 December 1992
  772.  
  773.  
  774. As the FAQ list is quite long, I'm posting diffs for those of you who
  775. already have copies of last month's edition (dated 15 November).  If you
  776. want the complete list, don't worry:  I'm posting it at about the same
  777. time but as a separate thread:  look for "comp.os.msdos.programmer FAQ
  778. part" in the Subject line.
  779.  
  780. As usual, I've omitted trivial diffs, those involving only formatting
  781. and punctuation, and those that show renumbered Qs with no text change.
  782.  
  783. Key:  "-" lines were in last month's FAQ list; "+" lines are in this
  784. month's.  Line numbers are approximate only.
  785.  
  786. -  67>    207. What's the difference between .COM and .EXE formats?
  787. +  67>    207. What's the format of an .OBJ file?
  788. +  68>    208. What's the format of an .EXE header?
  789. +  69>    209. What's the difference between .COM and .EXE formats?
  790.  
  791. -  91>    407. What's the format of an .EXE header?
  792. -  92>    408. What's the format of an .OBJ file?
  793. +  96>    410. What's the format of .OBJ, .EXE., .COM files?
  794.  
  795. + 176>New contributors this month:  Paul Ducklin, Mike Iarrobino, Duncan
  796. + 177>Murdoch, Anders Thulin, Curt Tilmes, rujo@extern.uio.no
  797.  
  798. - 260>    Readership report for Oct 92" in news.lists shows 40,000 readers of
  799. - 261>    this newsgroup worldwide.
  800. + 265>    Readership report for Nov 92" in news.lists shows 42,000 readers of
  801. + 266>    this newsgroup worldwide.  Traffic was 1090.7 Kbytes (exclusive of
  802. + 267>    crossposts), comprised in 611 articles.
  803.  
  804. - 314>      notices here.
  805. + 320>      notices to comp.os.msdos.programmer.
  806.  
  807. - 327>    - comp.binaries.ibm.pc.archives used to explain how to use the
  808. - 328>      archive sites, especially garbo and Simtel; but the archive
  809. - 329>      managers have stopped posting notices of uploads.  There is a vote
  810. - 330>      (through 7 December 1992) on creating a moderated group,
  811. - 331>      comp.archives.msdos.announce, to replace it.  In the meantime, you
  812. - 332>      can subscribe to upload announcements by sending mail containing
  813. - 333>      the text line "subscribe msdos-ann" and no signature to
  814. - 334>      listserv@tacom-emh1.army.mil.
  815. + 333>    - comp.binaries.msdos.announce (moderated) explains how to use the
  816. + 334>      archive sites, especially garbo and Simtel, and lists files
  817. + 335>      uploaded to them.  Discussions belong in comp.binaries.msdos.d,
  818. + 336>      which replaced comp.binaries.ibm.pc.archives.
  819.  
  820. + 351>    - Turbo Vision is a mailing list, not a newsgroup; send email to
  821. + 352>      listserv@vtvm1.cc.vt.edu if you want to subscribe.
  822.  
  823. + 522>Q207. What's the format of an .OBJ file?
  824. + 524>    Here's what I've been told, though I have verified any of these
  825. + 525>    references myself:
  826. + 527>    - base .OBJ format:  Intel's document number #121748-001, {8086
  827. + 528>      Relocatable Object Module Formats}.  (Note however that both
  828. + 529>      Microsoft and Borland formats have extended the .OBJ format.)
  829. + 531>    - Microsoft-specific .OBJ formats:  a "Microsoft OMF Specification"
  830. + 532>      (document number ??), as well as a section in the MS-DOS
  831. + 533>      encyclopedia.
  832. + 535>    - A "tutorial on the .OBJ format" comes with the VAL experimental
  833. + 536>      linker, which is VAL-LINK.ARC in PD1:<MSDOS.PGMUTL> at Simtel.
  834. + 538>    If you have specific references, either to fpt-able documents or to
  835. + 539>    published works (author, title, order number or ISBN), please email
  836. + 540>    them to brown@ncoast.org for inclusion in the next edition of this
  837. + 541>    list.
  838. + 543>Q208. What's the format of an .EXE header?
  839. + 545>    See pages 349-350 of {PC Magazine}'s June 30, 1992 issue (xi:12) for
  840. + 546>    the old and new formats.  For a more detailed layout, look under INT
  841. + 547>    21 function 4B in Ralf Brown's interrupt list.  Ralf Brown's list
  842. + 548>    includes extensions for Borland's TLINK and Borland debugger info.
  843.  
  844. - 528>    ISBN 1-55615-329-5.  Ralf Brown's interrupt list also documents the
  845. - 529>    .EXE header (including extensions by Borland's TLINK) at INT 21
  846. - 530>    function 4B, including New Executable and Linear Executable formats.
  847. + 553>    ISBN 1-55615-329-5.
  848.  
  849. - 517>Q207. What's the difference between .COM and .EXE formats?
  850. - 519>    To oversimplify:  a .COM file is a direct image of core, and an .EXE
  851. - 520>    file will undergo some further relocation when it is run (and so it
  852. - 521>    begins with a relocation header).  A .COM file is limited to 64K for
  853. - 522>    all segments combined, but an .EXE file can have as many segments as
  854. - 523>    your linker will handle and be as large as RAM can take.
  855. + 555>Q209. What's the difference between .COM and .EXE formats?
  856. + 557>    To oversimplify:  a .COM file is a direct image of core, and an .EXE
  857. + 558>    file will undergo some further relocation when it is run (and so it
  858. + 559>    begins with a relocation header).  A .COM file is limited to 64K for
  859. + 560>    all segments combined, but an .EXE file can have as many segments as
  860. + 561>    your linker will handle and be as large as RAM can take.
  861. + 563>    The actual file extension doesn't matter.  DOS knows that a file
  862. + 564>    being loaded is in .EXE format if its first two bytes are MZ or ZM;
  863. + 565>    otherwise it is assumed to be in .COM format.  For instance, I am
  864. + 566>    told that DR-DOS 6.0's COMMAND.COM is in .EXE format.
  865.  
  866. - 915>Q407. What's the format of an .EXE header?
  867. - 917>    See pages 349-350 of {PC Magazine}'s June 30, 1992 issue (xi:12) for
  868. - 918>    the old and new formats.  For a more detailed layout, look under INT
  869. - 919>    21 function 4B in Ralf Brown's interrupt list.
  870. - 921>Q408. What's the format of an .OBJ file?
  871. - 923>    I have seen a reference to Intel's document number #121748-001,
  872. - 924>    {8086 Relocatable Object Module Formats}, which covers the Intel
  873. - 925>    .OBJ format.  However, both Microsoft and Borland formats differ
  874. - 926>    from the base Intel format.  If you have specific references, either
  875. - 927>    to fpt-able documents or to published works (author, title, order
  876. - 928>    number or ISBN), please email them to brown@ncoast.org for inclusion
  877. - 929>    in the next edition of this list.
  878.  
  879. - 957>Q410. How can I read, create, change, or delete the volume label?
  880. - 959>    You can't do it using the more modern DOS functions (3C, 41, 43),
  881. - 960>    but the older FCB-oriented directory functions will do the job.
  882. - 961>    Specifically, you need to allocate a 64-byte buffer and a 41-byte
  883. - 962>    extended FCB (file control block).  Call INT 21 AH=1A to find out
  884. - 963>    whether there is a volume label.  If there is, AL will return 0 and
  885. - 964>    you can change the label using DOS function 17 or delete it using
  886. - 965>    DOS function 13.  If there is no volume label, function 1A will
  887. - 966>    return FF and you can create a label by using function 16.
  888. - 968>    The following MSC 7.0 code worked for me, where the parameter is 0
  889. + 977>Q408. How can I read, create, change, or delete the volume label?
  890. + 979>    In DOS 5.0 (and, I believe, in 4.0 as well), there are actually two
  891. + 980>    volume labels: one, the traditional one, is an entry in the root
  892. + 981>    directory of the disk; and the other is in the boot record along
  893. + 982>    with the serial number (see next Q).  The DIR and VOL commands
  894. + 983>    report the traditional label; the LABEL command reports the
  895. + 984>    traditional one but changes both of them.
  896. + 986>    In DOS 4.0 and later, use INT 21 function 69 to access the boot
  897. + 987>    record's serial number and volume label together; see the next Q.
  898. + 989>    Assume that by "volume label" you mean the traditional one, the one
  899. + 990>    that DIR and VOL display.  Though it's a directory entry in the root
  900. + 991>    directory, you can't change it using the newer DOS file-access
  901. + 992>    functions (3C, 41, 43); instead, use the old FCB-oriented directory
  902. + 993>    functions.  Specifically, you need to allocate a 64-byte buffer and
  903. + 994>    a 41- byte extended FCB (file control block).  Call INT 21 AH=1A to
  904. + 995>    find out whether there is a volume label.  If there is, AL returns 0
  905. + 996>    and you can change the label using DOS function 17 or delete it
  906. + 997>    using DOS function 13.  If there's no volume label, function 1A will
  907. + 998>    return FF and you can create a label via function 16.  Important
  908. + 999>    points to notice are that ? wildcards are allowed but * are not; the
  909. +1000>    volume label must be space filled not null terminated.
  910. +1002>    The following MSC 7.0 code worked for me in DOS 5.0; the functions
  911. +1003>    it uses have been around since DOS 2.0.  The function parameter is 0
  912.  
  913. - 971>    root directory for volume labels.  This code should work for DOS
  914. - 972>    2.0+, though I tested it only under DOS 5.0.  (I don't know what
  915. - 973>    happens with networked drives.)
  916. - 975>    Important points to notice are that ? wildcards are allowed but *
  917. - 976>    are not; the volume label must be space filled not null-terminated.
  918. +1006>    root directory for volume labels.  (I didn't try to change the
  919. +1007>    volume label of any networked drives.)
  920. +1009>    // Requires DOS.H, STDIO.H, STRING.H
  921.  
  922. -1023>Q411. How can I get the disk serial number?
  923. +1055>Q409. How can I get the disk serial number?
  924.  
  925. +1061>    This function also gets and sets the volume label, but it's the
  926. +1062>    volume label in the boot record, not the volume label that a DIR
  927. +1063>    command displays.  See the preceding Q.
  928. +1065>Q410. What's the format of .OBJ, .EXE., .COM files?
  929. +1067>    Please see section 2, "Compile and link".
  930.  
  931. -1256>    I'm outside my expertise on this one, but in November 1992 Jamshid
  932. -1257>    Afshar (jamshid@emx.utexas.edu) kindly supplied the following:
  933. +1296>    I'm outside my expertise on this one, but in late 1992 Jamshid
  934. +1297>    Afshar (jamshid@emx.utexas.edu) kindly supplied the following, which
  935. +1298>    incorporates some corrections agreed with Duncan Murdoch (dmurdoch@
  936. +1299>    mast.queensu.ca).  If you have any corrections or comments, please
  937. +1300>    send them to both the above addresses.
  938.  
  939. -1260>    1. Use XMS memory (don't bother with EMS).  There are some libraries
  940. -1261>    available at Simtel to access XMS.  The disadvantage is that you
  941. +1303>    1. Use XMS or EMS memory.  XMS is preferable in most cases, but
  942. +1304>    some machines won't provide it.  There are some libraries available
  943. +1305>    at Simtel to access XMS or EMS.  The disadvantage is that you
  944.  
  945. -1268>    program will run on even 286s.
  946. -1270>    2. Program under MS Windows.  MS Windows functions as a DOS extender
  947. -1271>    (see #3).  Borland/Turbo C++ 3.0 includes EasyWin [and Microsoft
  948. -1272>    C/C++ 7.0 has QuickWin --ed.] which is a library that automatically
  949. -1273>    lets you compile your current code using C/C++ standard input or
  950. -1274>    <conio.h>'s gotoxy() into a MS Windows program so your code can
  951. -1275>    immediately allocate many MBs of memory (Windows enhanced mode even
  952. -1276>    does virtual memory).  The disadvantage of MS Windows is that any
  953. -1277>    one object (e.g., a single malloc( )) is still restricted to 64K
  954. -1278>    (unless you want to mess with huge pointers in Windows).
  955. -1280>    3. Use a DOS extender.  This is definitely the best solution from
  956. -1281>    the programmer's standpoint.  You just allocate as much memory as
  957. -1282>    you need using malloc( ) or `new' and you don't have to worry about
  958. -1283>    any 64K limits.  It doesn't require source code changes and unlike
  959. -1284>    option #1 your code is portable and not obsolete in a few months.
  960. -1285>    Your options for this solution are:
  961. -1287>    - Buy PharLap's DOS extender (286 or 386 version) that works with
  962. -1288>      BC++ 3.0+ (just requires a relink).  Note, the BC++ 3.1 upgrade
  963. -1289>      came with PharLap "lite".
  964. -1291>    - Get the GNU (free,copylefted) gcc 2.1 compiler/extender that was
  965. -1292>      ported to MS-DOS and runs on 386 machines (supports C and C++).
  966. -1293>      FTP to barnacle.erc.clarkson.edu and get pub/msdos/djgpp/readme.
  967. -1295>    - Wait for Borland's DOS extender package (in BC++ 4.0) that is
  968. -1296>      supposed to be released at the end of this year.  I believe MS is
  969. -1297>      also doing the same.  Zortech 3.0 comes with a DOS extender, but I
  970. -1298>      wouldn't recommend the product.
  971. -1300>    4. This option doesn't really count since it's not a solution in
  972. +1312>    program will easily run on even 286s.
  973. +1314>    2.  Program under MS Windows.  MS Windows functions as a 16-bit DOS
  974. +1315>    Extender (see #3).  Borland/Turbo C++ 3.x includes EasyWin [and
  975. +1316>    Microsoft C/C++ 7.0 has QuickWin --ed.] which is a library that
  976. +1317>    automatically lets you compile your current code using C/C++
  977. +1318>    standard input or <conio.h> into a MS Windows program so your code
  978. +1319>    can immediately allocate many MBs of memory (Windows enhanced mode
  979. +1320>    even does virtual memory).  The disadvantage is that like any 16-bit
  980. +1321>    Extender a single malloc() is restricted to 64K (unless you want to
  981. +1322>    mess with huge pointers in Windows).  Also, EasyWin's screen output
  982. +1323>    is significantly slower than a DOS character-mode program's and you
  983. +1324>    must of course run the program from Windows.
  984. +1326>    3.  Use a 16-bit or 32-bit DOS Extender.  This is definitely the
  985. +1327>    best solution from the programmer's standpoint.  You just allocate
  986. +1328>    as much memory as you need using malloc() or 'new'.  A 16-bit
  987. +1329>    Extender still has 16-bit ints and restricts arrays to 64K, but a
  988. +1330>    32-bit Extender has 32-bits ints (which makes porting a lot of UNIX
  989. +1331>    code easier) so there are no 64K limits.  A 32-bit Extender requires
  990. +1332>    a 32-bit compiler and the program will not run on 286s.  Some
  991. +1333>    Extenders also do virtual memory.  Using an Extender doesn't require
  992. +1334>    source code changes and unlike option #1 your code is portable and
  993. +1335>    not obsolete in a few months.  Your options for this solution are:
  994. +1337>    - Buy PharLap's 16-bit Extender that works with BC++ 3.0+ and MSC
  995. +1338>      (just requires a relink).  Note, the BC++ 3.1 upgrade came with
  996. +1339>      PharLap "lite".  Pharlap's 32-bit Extender works with 32-bit
  997. +1340>      compilers like [?]
  998. +1342>    - Get the GNU (free,copylefted) gcc 2.x compiler which DJ Delorie
  999. +1343>      ported from UNIX and which uses his 32-bit Extender.  It supports
  1000. +1344>      C and C++, but the Extender is VCPI which means neither the
  1001. +1345>      compiler nor programs it produces will run in a DOS session under
  1002. +1346>      Windows.  FTP to barnacle.erc.clarkson.edu and get
  1003. +1347>      pub/msdos/djgpp/readme.
  1004. +1349>    - Get a 32-bit compiler or one that comes with a DOS Extender.
  1005. +1350>      Zortech comes with 16-bit and a 32-bit Extenders (no debugger for
  1006. +1351>      32-bit programs, but Flashtek sells one).  Watcom also makes a C
  1007. +1352>      [and C++?] 32-bit compiler.  [If anyone else has products or plans
  1008. +1353>      to announce, please let me know.]
  1009. +1355>    - Buy Borland Pascal 7.0.  It includes a 16 bit royalty-free DOS
  1010. +1356>      extender using the same interface as MS Windows.  It functions
  1011. +1357>      under a DPMI server like Windows or QDPMI from Quarterdeck, and
  1012. +1358>      also provides its own server which you can distribute with your
  1013. +1359>      programs.
  1014. +1361>    4.  This option doesn't really count since it's not a solution in
  1015.  
  1016. -1302>    OS/2 2.0 or UNIX (or Win32/NT when it comes out).  Borland is
  1017. -1303>    putting its OS/2 compiler into beta now.  OS/2 is doing well (and it
  1018. -1304>    runs DOS or Windows programs).  BC++ for OS/2 should also be a
  1019. -1305>    success and there should be a good upgrade path from current Borland
  1020. -1306>    compilers.
  1021. +1363>    OS/2 2.0 or UNIX (or NT when it comes out).  I believe Win32 will
  1022. +1364>    allow you to write 32-bit Windows programs.  [can someone fill me in
  1023. +1365>    on what exactly Win32 is?]
  1024.  
  1025. -1605>    In PD1:<MSDOS.PGMUTL> at Simtel you'll find RCS55.ZIP.  I haven't
  1026. +1664>    In PD1:<MSDOS.PGMUTL> at Simtel you'll find RCS56DOS.ZIP.  I haven't
  1027.  
  1028. -1607>    utility, but is limited to one-character extensions on filenames (no
  1029. -1608>    .CPP).  A correspondent wrote that he has an RCS port to DOS that is
  1030. -1609>    not limited to one-character extensions, but he doesn't remember
  1031. -1610>    where he got it.  Anyone have a verified archive site?
  1032. +1666>    utility, and is no longer limited to one-character extensions on
  1033. +1667>    filenames (so .CPP and .BAS are fine).
  1034.  
  1035. (end of diffs for comp.os.msdos.programmer FAQ)
  1036. --
  1037. Stan Brown, Oak Road Systems                      brown@Ncoast.ORG
  1038. Cleveland, Ohio, USA
  1039. Xref: bloom-picayune.mit.edu comp.os.msdos.programmer:18888 news.answers:4711
  1040. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!mcsun!uknet!doc.ic.ac.uk!agate!ames!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ncoast!brown
  1041. From: brown@NCoast.ORG (Stan Brown)
  1042. Newsgroups: comp.os.msdos.programmer,news.answers
  1043. Subject: comp.os.msdos.programmer FAQ part 1 of 4
  1044. Message-ID: <msdos-faq.921220.1@NCoast.ORG>
  1045. Date: 20 Dec 92 20:12:47 GMT
  1046. Expires: Wed, 3 Feb 1993 20:12:47 GMT
  1047. References: none
  1048. Followup-To: comp.os.msdos.programmer
  1049. Organization: Oak Road Systems, Cleveland Ohio USA
  1050. Lines: 190
  1051. Approved: news-answers-request@MIT.Edu
  1052. Supersedes: <msdos-faq.921205.1@NCoast.ORG>
  1053.  
  1054. Archive-name: msdos-programmer-faq/part1
  1055. Last-modified: 20 December 1922
  1056.  
  1057.  
  1058. This is the monthly FAQ list (Frequently Asked Questions list) for the
  1059. newsgroup comp.os.msdos.programmer.  Parts 2 through 4 of this article
  1060. are posted as followups in the same thread.  If the posting date shown
  1061. above is more than six weeks in the past, see instructions in part 4 of
  1062. this list for how to get an updated copy.  (A separate article holds the
  1063. changes from last month's edition.  Look for the subject line
  1064. "comp.os.msdos.programmer FAQ diffs".)
  1065.